package com.wolfheader.wolfgame.entity.admin;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.wolfheader.wolfgame.entity.BaseEntity;

@Entity
@Table(name = "t_permission")
public class PermissionEntity extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9072387321433883604L;

	/**
	 * 权限名称
	 */
	private String permissionname;

	/**
	 * 权限介绍
	 */
	private String intro;

	/**
	 * 角色
	 */
	private List<RoleEntity> roles;// 一个权限对应一个角色

	/**
	 * perms[admin:list] 内容
	 */
	private String content;

	/**
	 * /admin/** 连接
	 */
	private String path;

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	@Column(nullable = false)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	@Column(nullable = false)
	public String getPermissionname() {
		return permissionname;
	}

	public void setPermissionname(String permissionname) {
		this.permissionname = permissionname;
	}

	@ManyToMany(mappedBy = "permissions", fetch = FetchType.EAGER)
	public List<RoleEntity> getRoles() {
		return roles;
	}

	public void setRoles(List<RoleEntity> roles) {
		this.roles = roles;
	}

}
